import request from '../utils/require';

interface LoginResponse {
  success: boolean;
  message: string;
  data?: any;
}

export function login(account: string, password: string): Promise<LoginResponse> {
  return request({
    url: '/api/user/login',
    method: 'post',
    data: { account, password }
  });
}

export function register(account: string, password: string): Promise<LoginResponse> {
  return request({
    url: '/api/user/register',
    method: 'post',
    data: { account, password }
  });
}